<template>
    <nut-button type="primary" @click="routeTo('home')">跳转首页</nut-button>
    <nut-button type="success" @click="routeTo('about')">跳转关于</nut-button>
    <RouterView></RouterView>
</template>

<script setup lang="ts">
import { RouterView, useRoute, useRouter } from 'vue-router'
const router = useRouter()
const route = useRoute()

const routeTo = (path: string) => {
    console.log(path)
    router.push({
        path,
        query: {
            ...route.query
        }
    })
}
</script>
